﻿using Abp.Application.Services.Dto;
using shenghua.Common.Articles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Articles.Dto
{
    public class CreateArticleDto
    {
        public string Title { get; set; }
        public List<string> Tags { get; set; }
        public string Author { get; set; }
        public string Source { get; set; }
        public string Description { get; set; }
        public string Picture { get; set; }
        public List<string> Pictures { get; set; }
        public string Content { get; set; }
        public ArticleSystemType SystemType { get; set; }
        public string Type1 { get; set; }
        public string Type2 { get; set; }
        public string Type3 { get; set; }
        public ArticleStatus Status { get; set; }

        public CreateArticleDto()
        {
            Tags = new List<string>();
            Pictures = new List<string>();
        }

        public void MapTo(Article article)
        {
            article.Title = Title;
            article.Tags = new Common.CustomValueType.ValueArray<string>(Tags);
            article.Author = Author;
            article.Source = Source;
            article.Description = Description;
            article.Picture = Picture;
            article.Pictures = new Common.CustomValueType.ValueArray<string>(Pictures);
            article.Content = Content;
            article.SystemType = SystemType;
            article.Type1 = Type1;
            article.Type2 = Type2;
            article.Type3 = Type3;
            article.Status = Status;
        }
    }
}
